#/bin/bash
find . -name "*.cpp"|xargs sed -n "/round([ a-zA-Z_]\{1,20\})/p"
find . -name "*.cpp"|xargs sed -i 's/round(\([ ]*float[ ]*\)\([^/]\+\/.\+\))/round(double\2)/'
find . -name "*.cpp"|xargs sed -i 's/round(\([^/()]\+\)\/\(.\+\))/round((double)\1\/\2)/'
find . -name "*.cpp"|xargs sed -i 's/round(\(([^/]\+)\) *\/ *\([^(]\+\))/round((double)\1 \/ \2)/'

find . -name "*.cu"|xargs sed -n "/round([ a-zA-Z_]\{1,20\})/p"
find . -name "*.cu"|xargs sed -i 's/round(\([ ]*float[ ]*\)\([^/]\+\/.\+\))/round(double\2)/'
find . -name "*.cu"|xargs sed -i 's/round(\([^/()]\+\)\/\(.\+\))/round((double)\1\/\2)/'
find . -name "*.cu"|xargs sed -i 's/round(\(([^/]\+)\) *\/ *\([^(]\+\))/round((double)\1 \/ \2)/'
